package com.glela.order.service;

import java.util.Map;

import org.springframework.http.ResponseEntity;

import com.glela.order.model.AfterSales;
import com.glela.order.model.OrderPay;
import com.glela.order.model.request.RequestAfterSalesModel;

/**
 * 
 * @author MaoZeYao
 *
 */
public interface AfterSalesService {
	
	/**
	 * 发起售后申请
	 * @return
	 */
	public ResponseEntity<?> launchAfterSalesApplication(RequestAfterSalesModel model) throws Exception;

	/**
	 * 保存售后申请
	 * @param model
	 * @return
	 */
	public ResponseEntity<?> saveAfterSalesApplication(RequestAfterSalesModel model) throws Exception;
	
	/**
	 * 保存申诉
	 * @param model
	 * @return
	 */
	public ResponseEntity<?> saveAfterSaleComplaint(RequestAfterSalesModel model) throws Exception;
	
	/**
	 * 查询所有售后中的订单
	 * @param userId
	 * @return
	 */
	public ResponseEntity<?> findAfterSalesByUserId(RequestAfterSalesModel model);
	
	/**
	 * 查询售后详情
	 * @param afterSalesId
	 * @return
	 */
	public ResponseEntity<?> findAfterSalesById(Long afterSalesId);
	
	/**
	 * 修改图片凭证
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public ResponseEntity<?> changeImagePools(RequestAfterSalesModel model) throws Exception;
	
	/**
	 * 填写回寄信息
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public ResponseEntity<?> fillInTheDeliveryInformation(RequestAfterSalesModel model)throws Exception;
	
	/**
	 * 发起售后申述
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public ResponseEntity<?> launchComplaintApplication(Long afterSalesId)throws Exception;

	/**
	 * 售后同意
	 * @param afterSale
	 * @param OrderPay
	 * @param divideString
	 * @throws Exception
	 */
	public void userRefundSuccess(AfterSales afterSale) throws Exception;
	
	/**
	 * 拒绝售后
	 * @param afterSale
	 * @return
	 * @throws Exception
	 */
	public ResponseEntity<?> storeRefusedAfterSales(long afterSalesId,String storeRefuseReason,String storeRefuseReason1) throws Exception;
	
	/**
	 * 查询总价格
	 * @return
	 */
	public long getFatherOrdersOfTotalPrice(long orderObjectId);
	
	/**
	 * 成功退款的金额
	 * @param orderObjectId
	 * @return
	 */
	public long getRefundSuccessMoney(long orderObjectId);
	
	/**
	 * 校妆请求接口  入库通知
	 * @param appKey
	 * @param data
	 * @param sign
	 * @return
	 */
	public ResponseEntity<?> afterSalesNotice(String appKey, String data, String sign);
	
	/**
	 * 拒收包裹自动进入售后流程
	 * @param appKey
	 * @param data
	 * @param sign
	 * @return
	 */
	public ResponseEntity<?> afterSalesRejection(String appKey, String data, String sign);
	
	public void omsReturn(String orderSn);

	/**
	 * 验证售后单
	 * @param afterSales
	 * @return  Map<String, Object> key:售后单号 value:异常原因
	 * @author gaoweiqi 
	 */
	public Map<String, Object> validationAfterSales(AfterSales afterSales);
	
}
